package main

import (
	//"math/rand"
	"t/log"
	"t/tt/nsqlib"
)

func main() {
	log.IniLog()

	nsqlib.NewConsumer("pgman","pgmanA")

	//tr := tree.CreateExampleTree()
	//MidDisPlay(tree)

	//tree.PrePrint(tr)

	//sl := list.NewList()
	////var a = 0
	//for i:=0;i<10;i++{
	//	sl.Append(i)
	//}
	//sl.PopTail()
	//sl.Insert(999,4)
	//sl.PrintNode()


	//tt.TimeDemo()
	//tt.TestReF()
	//tt.TestInter()
	//tt.TestStr()

	//tt.TestPool()
	//tt.DoIt()
	//tt.CheckM()
	//tt.TestSlice()

	//tt.Cronddemo()
	//pprof.StartCPUProfile(os.Stdout)
	//defer pprof.StopCPUProfile()
	//fmt.Println("开始")
	//tt.PrintValue("aa")
	// 读取初始化配置文件
	//filename := "..\\logAgent.conf"
	//err := config.loadInitConf("ini", filename)
	//if err != nil {
	//	fmt.Printf("导入配置文件错误:%v\n", err)
	//	panic("导入配置文件错误")
	//	return
	//}

	//limit :=rate.NewLimiter(rate.Every(time.Second),5)
	//limit.Burst()

	//locRedis := redis.New("192.168.10.223:6379")
	//locRedis.Pass = "baobaobooks"
	//
	//tokLimit := limit.NewTokenLimiter(1,2,locRedis,"testlimitpgman1")
	//for {
	//
	//	ok := tokLimit.AllowN(time.Now(),2)
	//	if !ok {
	//		fmt.Printf("bbb")
	//		return
	//	}
	//	fmt.Printf("aaa")
	//	time.Sleep(time.Second)
	//}
}
